﻿package com.rover022.webgame.view.game {
	import com.ass.Itembg;
	import com.ass.Renwu;

	import org.aswing.JPanel;
	import org.aswing.LayoutManager;

	import mx.events.DragEvent;

	import flash.events.MouseEvent;

	/**
	 * @author chenbin01
	 */
	public class ItemPanel extends JPanel {
		public var _class : Renwu;
		public var bg_sprite : Itembg;
		private var _price : Number;

		public function ItemPanel(_price : Number,layout : LayoutManager = null) {
			super(layout);
			_price = _price;
			
			
			setSizeWH(48, 65);
			bg_sprite = new Itembg();
			addChild(bg_sprite);
			addEventListener(MouseEvent.CLICK, mousedown_listener);
			
			//设置具有拖放能力;
			setDropTrigger(true);
			addEventListener(DragEvent.DRAG_ENTER, enter_listener);
			addEventListener(DragEvent.DRAG_DROP, drop_listener);
			addEventListener(DragEvent.DRAG_EXIT, exit_listener);
		}

		public function is_enble(src : Number) : void {
			buttonMode = (src >= _price);
		}

		
		private function mousedown_listener(event : MouseEvent) : void {
			//var event:
			
			
		}

		private function exit_listener(event : DragEvent) : void {
		}

		private function drop_listener(event : DragEvent) : void {
		}

		private function enter_listener(event : DragEvent) : void {
		}

		private function setbgobj() : void {
		}
	}
}
